package br.com.duosoftware.daos;

import br.com.duosoftware.entidades.Inscricao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 *
 * @author Daniel
 *
 */
public class InscricaoDAO {

    public boolean add(Inscricao inscricao) throws SQLException {

        String command = "INSERT INTO inscricoes (nome, telefone, celular, email, experiencia, descricao) "
                       + "VALUES (?,?,?,?,?,?)";

        Connection connection = ConnectionFactory.getConnection();

        PreparedStatement ps = connection.prepareStatement(command);

        ps.setString(1, inscricao.getNome());

        ps.setString(2, inscricao.getTelefone());

        ps.setString(3, inscricao.getCelular());

        ps.setString(4, inscricao.getEmail());

        ps.setString(5, inscricao.getExperiencia());

        ps.setString(6, inscricao.getDescricao());

        return ps.execute();

    }

}
